package ken.app.bean;

import java.io.Serializable;
import java.sql.Timestamp;

import ken.app.even.KenEventManager;

public class PersonalBean
{ 

	private int cht_sn= 0;
	private int user_type= -1;
	private String account="";
	private String password = "";
	private String nickname= "";
	private String membername = "";
	private String guestname= "";
	private String guestmobile = "";
	private String loginMessage = "";
	private int result= -1;
	private int total_score = 0;
	private int fruit_get = -1;
	private int fruit_surplus = -1;

	private static PersonalBean mPersonalInfo = null;
	
	public static PersonalBean getInstance() {
		if(mPersonalInfo == null) {
			mPersonalInfo = new PersonalBean();
//			if (KenEventManager.getInstance().getCHTsn()!=0) {
//				mPersonalInfo.setChtsn(KenEventManager.getInstance().getCHTsn());
//				mPersonalInfo.setNickname(KenEventManager.getInstance().getNICKName());
//
//			}else{
//				mPersonalInfo.setGuestname(KenEventManager.getInstance().getGuestname());
//				mPersonalInfo.setGuestmobile(KenEventManager.getInstance().getGuestMobile());
//			}
			mPersonalInfo.setChtsn(KenEventManager.getInstance().getCHTsn());
			mPersonalInfo.setNickname(KenEventManager.getInstance().getNICKName());
			mPersonalInfo.setGuestname(KenEventManager.getInstance().getGuestname());
			mPersonalInfo.setGuestmobile(KenEventManager.getInstance().getGuestMobile());

		}

		return mPersonalInfo;
	}

//	public PersonalInfo(int totalmsg, int pagelimit, int pagecurrent, int itemmid, String itemname, int itemdate,
//					String itemdescription, String treename){
//		cht_sn = totalmsg;
////		user_type = pagelimit;
//		account = itemname;
//		password = itemdescription;
//
//	}
	
	public PersonalBean(){
		
	}
	
	public void setChtsn(int chtsn){
		cht_sn = chtsn;
	}
	
	public int getChtsn(){
		return cht_sn;
	}
	
	public void setTotalScore(int totalscore){
		total_score = totalscore;
	}
	
	public int getTotalScore(){
		return total_score;
	}
	
	public void setFruitGet(int fruitget){
		fruit_get = fruitget;
	}
	
	public int getFruitGet(){
		return fruit_get;
	}
	
	public void setFruitSurplus(int fruitsurplus){
		fruit_surplus = fruitsurplus;
	}
	
	public int getFruitSurplus(){
		return fruit_surplus;
	}
	
	public void setUserType(int usertype){
		user_type = usertype;
	}
	
	public int getUserType(){
		return user_type;
	}
		
	public void setAccount(String account){
		this.account = account;
	}
	
	public String getAccount(){
		return account;
	}
	
	public void setPassword(String password){
		this.password = password;
	}
	
	public String getPassword(){
		return password;
	}
	
	public void setNickname(String nickname){
		this.nickname = nickname;
	}
	
	public String getNickname(){
		return nickname;
	}
	
	public void setGuestname(String guestname){
		this.guestname = guestname;
	}
	
	public String getGuestname(){
		return guestname;
	}
	
	public void setGuestmobile(String guestmobile){
		this.guestmobile = guestmobile;
	}
	
	public String getLoginMessage(){
		return loginMessage;
	}
	
	public void setLoginMessage(String message){
		this.loginMessage = message;
	}
	
	public String getGuestmobile(){
		return guestmobile;
	}
	
	public void setMembername(String membername){
		this.membername = membername;
	}
	
	public String getMembername(){

		if (membername.length()>8) {
			return membername.substring(0, 6)+"...";
		}else{
			return membername;
		}
		
		
	}
	
	public void setResult(int result){
		this.result = result;
	}
	
	public int getResult(){
		return result;
	}
			
}